<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Forma</title>
<link rel="stylesheet" href="../style.css" />

<script src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js" type="text/javascript"></script>

<script type="text/javascript">
	
	$(document).ready( function() {
		$('#button').click( function() {
			$('#popup').fadeIn("slow");
			return false;
		})
	});
</script>
</head>

<body>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Broj: <input type="text" name="broj" />
<input id="button" type="submit" value="OK" name="OK" />
</form>

<div id="popup">
<div>

 <?php
 
 if(isset($_POST['broj'])) {

echo '';

echo $_POST["broj"];
 
 
  $input = $_POST["broj"];
 $total_divisors = 0;
 for($i=1; $i < $input; $i++) {
   if ($input % $i == 0) $total_divisors++;
 }

 
if ($total_divisors > 1) {
	
	echo ' je slozen broj.<br class="clear"/>';
}
else
{
	echo ' je prost broj.<br class="clear"/>';
}
 
echo 'Deljiv je sa ';
for ($s=1; $s < $_POST["broj"]; $s++) {
	if ($_POST["broj"] % $s ==0)
		echo ''.$s.', ';
}
echo $_POST["broj"].'


'; }
  ?>
<br/><br/><br/>
<a id="close">Nazad</a>
</div></div>
</body>
</html>